let v = new Vue({
    el:'#main-container',
    data:{
        pageInfo:{
            pageSize:3,
        },
        meeting:{

        }
    },
    methods:{
        selectByName:function (page,pageSize) {
            axios({
                url:`main/meeting/selectByPage/${page}/${pageSize}`,
                data:this.meeting,
                method:'post',
            }).then(resp => {
                this.pageInfo = resp.data.obj;
            }).catch(error => {
                layer.msg(error.message);
            })
        },
        selectByPage:function (page,pageSize) {
            this.meeting.title = '';
            this.meeting.status = '';
            this.selectByName(page,pageSize)
        },

        toMeetingDetail:function (meeting) {
            let loginUser = JSON.parse(sessionStorage.getItem("loginUser"));
            if(loginUser.deptId == meeting.deptId){
                if(meeting.status == 2){
                    layer.msg("会议已结束！");
                }else{
                    layer.meeting = meeting;
                    layer.open({
                        type: 2,
                        title: '会议详情',
                        area: ['70%', '80%'],
                        content: 'main/meeting/toMeetingDetail',
                        end:() => {

                        }
                    })
                }

            }else{
                layer.msg("不是这个部门的不能进入");
            }




        },
        toAddMeeting:function () {
            layer.open({
                type: 2,
                title: '会议详情',
                area: ['70%', '80%'],
                content: 'main/meeting/toAddMeeting',
                end:() => {

                }
            })
        },
        checkStatus:function () {
            axios({
                url:'main/meeting/checkStatus',
            }).then(resp => {

            }).catch(error => {
                layer.msg(error.message);
            })
        }
    },
    created:function () {
        this.checkStatus();
        this.selectByPage(1,this.pageInfo.pageSize);
    }
})